using System;
using System.Data;
using System.Data.SqlClient;
using LibreriaCommon;
using LibreriaData;
using Microsoft.Practices.EnterpriseLibrary.Data;
using SistemaControlTraficoLibDS;
namespace SistemaControlTraficoLibData
{
    public class daCliente : daClienteBase, IDisposable
    {
        public daCliente(SecurityInfo securityInfo) : base(securityInfo)
        {
        }

        public DataSet FindByFiltros(string clienteRazonSocial, string clienteTelefono, string clienteContacto, object estado)
        {
            try
            {
                DataSet ds = new DataSet();
                daCommon.GenericFind(securityInfo, "ClienteFindByFiltros", ds, new string[] { "Cliente" }, clienteRazonSocial, clienteTelefono, clienteContacto, estado);
                return ds;
            }
            catch (Exception ex)
            {
                throw new daException(ex);
            }
        }

        public virtual DataSet FindByTexto(string texto)
        {
            try
            {
                DataSet ds = new DataSet();
                daCommon.GenericFind(securityInfo, "ClienteFindByTexto", ds, new string[] { "Cliente" }, texto);
                return ds;
            }
            catch (Exception ex)
            {
                throw new daException(ex);
            }
        }

        public virtual dsCliente FindByRazonSocial(string ClienteRazonSocial)
        {
            try
            {
                dsCliente ds = new dsCliente();
                daCommon.GenericFind(securityInfo, "ClienteFindByRazonSocial", ds, new string[] { ds.Cliente.TableName }, ClienteRazonSocial);
                return ds;
            }
            catch (Exception ex)
            {
                throw new daException(ex);
            }
        }

    }
}

